#include<fstream>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
    char a[100];
    int i=0;
    while(1)
    {
       cin>>a[i];
       cout<<a[i]-'1'<<endl;
       i++;
       } 
    system("pause");
    return 0;
}
